package com.example.yyjc.mapper;

import com.example.yyjc.domain.industryanalyze.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @ClassName IndudtryAnalyzeMapper
 * @Description TODO
 * @Author lvyongwei
 * @Date 2020-11-19 16：05
 **/
@Mapper
public interface IndustryAnalyzeMapper {

    /**
     * 获取一级标题名称以及各个月份销售额
     * @return
     */
    public List<FirstCat> getFirstCatTitle();

    /**
     * 根据一级标题id获取所有二级标题和销量
     * @param firstCatTitleId
     * @return
     */
    public List<SecondCatSale> getSecondCatTitle(Integer firstCatTitleId);

    /**
     * 获取二级标题在一级标题中所占的比例
     * @param secondCatTitleId
     * @return
     */
    public List<SecondCatSale> getScale(Integer secondCatTitleId);

    /**
     * 获取二级标题销售量
     * @param secondCatTitleId
     * @param times
     * @return
     */
    public List<SecondCatSale> getSecondCatSalesVolume(@Param("secondCatTitleId") Integer secondCatTitleId,@Param("times")List<String> times);

    /**
     * 获取二级类目国家销量
     * @param secondCatTitleId  二级类目id
     * @param time
     * @return
     */
    public List<SecondCatSale> getCountryRanking(@Param("secondCatTitleId") Integer secondCatTitleId,@Param("time")String time);

    /**
     * 获取二级类目国家总销量和
     * @param secondCatTitleId  二级类目id
     * @param time
     * @return
     */
    public Double getCountrySum(@Param("secondCatTitleId") Integer secondCatTitleId,@Param("time")String time);

    /**
     * 获取发货前三的国家
     * @param secondCatTitleId
     * @return
     */
    public List<String> getDeliveryCountry(Integer secondCatTitleId);

    /**
     * 获取前三国家各个月份发货订单数量
     * @param countryName
     * @param times
     * @param secondCatId
     * @return
     */
    public List<String> getDeliveryCountryCount(@Param("countryName")String countryName,@Param("times")List<String> times,@Param("secondCatTitleId")Integer secondCatId);

    /**
     * 获取行业某个月份卖家发货信息
     * @param secondCatTitleId
     * @param time
     * @return
     */
    public List<DeliveryCountry> getAllDeliveryCountryCount(@Param("secondCatTitleId") Integer secondCatTitleId,@Param("time")String time);

    /**
     * 获取价格区间
     * @return
     */
    public List<String> getPriceSection();

    /**
     * 获取各个月份价格区间内商品数量
     * @param secondCatId
     * @param times
     * @param priceSection
     * @return
     */
    public List<Integer> getGoodsCount(@Param("times")List<String> times,@Param("secondCatTitleId")Integer secondCatId,@Param("priceSection")String priceSection);

    /**
     * 获取各个月份价格区间内商品数量比例
     * @param times
     * @param secondCatId
     * @param priceSection
     * @return
     */
    public List<Double> getGoodsCountScale(@Param("times")List<String> times,@Param("secondCatTitleId")Integer secondCatId,@Param("priceSection")String priceSection);

    /**
     * 获取订单区间
     * @return
     */
    public List<String> getOrderSection();

    /**
     * 获取各个月份订单区间内商品数量
     * @param secondCatId
     * @param times
     * @param orderSection
     * @return
     */
    public List<Integer> getOrderCount(@Param("times")List<String> times,@Param("secondCatTitleId")Integer secondCatId,@Param("orderSection")String orderSection);

    /**
     * 获取各个月份订单区间内商品数量比例
     * @param times
     * @param secondCatId
     * @param orderSection
     * @return
     */
    public List<Double> getOrderCountScale(@Param("times")List<String> times, @Param("secondCatTitleId")Integer secondCatId, @Param("orderSection")String orderSection);

    /**
     * 获取二级类目店铺top10
     * @param secondCatId
     * @param time
     * @return
     */
    public List<SecondCatShopTopTen> getSecondCatShopTopTen(@Param("secondCatTitleId") Integer secondCatId,@Param("time") String time);

    /**
     * 获取二级类目商品top10
     * @param secondCatId
     * @param time
     * @return
     */
    public List<SecondCatGoodsTopTen> getSecondCatGoodsTopTen(@Param("secondCatTitleId") Integer secondCatId,@Param("time") String time);

    /**
     * 获取销量top10国家的top3物流渠道
     * @param secondCatId
     * @param time
     * @return
     */
    public List<SecondCatTopLogistics> getTopTenCountryLogistics(@Param("secondCatTitleId") Integer secondCatId,@Param("time") String time);

    /**
     * 获取top1物流订单量前三的国家
     * @param secondCatId
     * @param beginTime
     * @param endTime
     * @return
     */
    public List<String> getTopOneLogisticsTopThree(@Param("secondCatTitleId") Integer secondCatId,@Param("beginTime")String beginTime,@Param("endTime") String endTime);

    /**
     * 获取国家各个月份top1物流的订单数量
     * @param secondCatId
     * @param times
     * @param countryName
     * @return
     */
    public List<Integer> getCountryTopOneLogisticsCount(@Param("secondCatTitleId") Integer secondCatId,@Param("times") List<String> times,@Param("countryName") String countryName);

    /**
     * 获取Aliexpress前三国家名称
     * @return
     */
    public List<String> getAliexpressTopCountry();

    /**
     * 获取Aliexpress前三国家各个月份订单占比
     * @param countryName   `
     * @param times
     * @return
     */
    public List<Double> getAliexpressTopCountryScale(@Param("times") List<String> times,@Param("countryName") String countryName,@Param("countryNames")List<String> countryNames);

    /**
     * 获取Aliexpress前三类目名称
     * @return
     */
    public List<String> getAliexpressTopSecondCat();

    /**
     * 获取Aliexpress前三二级类目各个月份订单占比
     * @param secondCatNames
     * @param secondCatName
     * @param times
     * @return
     */
    public List<Double> getAliexpressTopSecondCatScale(@Param("times") List<String> times,@Param("secondCatName") String secondCatName,@Param("secondCatNames")List<String> secondCatNames);
}
